package me.zhengjie.utils;

import cn.hutool.http.HttpUtil;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.config.DebugProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

public class RefreshData {
    private static final Logger log = LoggerFactory.getLogger(RefreshData.class);

    public static void refresh(String sfz) {

        if(DebugProperties.rysfz.indexOf(sfz) == -1 ) {
            // 在测试人员中没indexof到，执行同步
            if(!DebugProperties.debug) {
                log.info("同步人员身份证：{} ", sfz);
                String url = "http://10.1.1.164:7003/pro/syncyb?certno="+sfz;
                HttpUtil.get(url);
            }
        } else {
            // 测试人员，不执行同步
            log.info("测试人员：{}, 不执行同步：{} ", DebugProperties.rysfz, sfz);
        }
    }
}
